// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

const { ccclass, property, executeInEditMode } = cc._decorator;

@ccclass
@executeInEditMode
export default class StencilClose extends cc.Component {
    protected onLoad(): void {
        let sprite = this.node.getComponent(cc.RenderComponent);
        let gfx = cc["gfx"];
        let mat = sprite.getMaterial(0);
        mat.setStencilEnabled(gfx.STENCIL_DISABLE, 0);
    }
} 
